package com.neusoft.tijian.mapper;

import com.neusoft.tijian.po.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface UsersMapper {
    //1. users/getUsersByUserIdByPass
    //  ○ 参数：Users对象
    //  ○ 返回值：Users对象
    //  ○ 功能：根据手机号码和密码进行登录验证
    @Select("SELECT * FROM users WHERE userId=#{userId} AND password = #{password}")
    Users getUsersByUserIdByPass(Users users);
    //2. users/getUsersById
    //  ○ 参数：Users对象
    //  ○ 返回值：Users对象
    //  ○ 功能：根据手机号码进行是否已注册验证
    @Select("SELECT * from users WHERE userId = #{userId}")
    Users getUsersById(Users users);
    //3. users/saveUsers
    //  ○ 参数：Users对象
    //  ○ 返回值：int
    //  ○ 功能：根据用户输入信息进行注册
    @Insert("insert into users(userId,password,realName,sex,identityCard,birthday,userType) value(#{userId},#{password},#{realName},#{sex},#{identityCard},#{birthday},#{userType})")
    int saveUsers(Users users);
}
